
function test1() {
  
    //获取当前时间
    var date = new Date();
    var now = date.getTime();
    //设置截止时间
    var endDate = new Date("2021-11-25 18:30:0");
    // console.log(endDate);
    var end = endDate.getTime();
    //获取截止时间和当前时间的时间差
    var leftTime = Math.floor((end - now)/1000);
    var hour, minute, second;
    if (leftTime >= 0) {
        hour = Math.floor(leftTime / 3600);
        minute = Math.floor((leftTime - hour * 3600) / 60);
        second = leftTime - hour * 3600 - minute * 60;
    }
    hour = hour < 10 ? '0' + hour : hour;
    document.getElementById("time").innerHTML = "<span class='time_bj'>" + hour + "</span>" + ":" + "<span class='time_bj'>" + minute + "</span>" + ":" + "<span class='time_bj'>" + second + "</span>";
    document.getElementById("time1").innerHTML = "<span class='time_bj'>" + hour + "</span>" + ":" + "<span class='time_bj'>" + minute + "</span>" + ":" + "<span class='time_bj'>" + second + "</span>";
    
    Time=setTimeout(test1,1000);
}
test1();
